﻿using System;
using System.Collections.Generic;
using SimpleFS.Core;
using SimpleFS.Core.Implementations;
using SimpleFS.Storage.Windows;
using SimpleFS.Services.Compression;
using SimpleFS.Services.Compression.Implementations;
using NUnit.Framework;

namespace SimpleFS.Specs.Services.Compression
{
    [TestFixture]
    public class FileTest
    {
        [Test]
        public void TestWrite()
        {
            string sourceFileName = @"../../Resources/practical-file-system-design.pdf";
            string targetFileName = @"../../Resources/practical-file-system-design.zip";

            System.IO.FileStream source 
                = new System.IO.FileStream(sourceFileName, System.IO.FileMode.Open);
            ICompressionServiceProvider provider = new GZipCompressionServiceProvider();
            SimpleFS.Storage.Windows.File windowsFile
                = new SimpleFS.Storage.Windows.File(targetFileName);

            SimpleFS.Services.Compression.File file
                = new SimpleFS.Services.Compression.File(windowsFile, provider);

            file.Write(source);
        }
    }
}
